package com.own.demo.长沙空中路网格子.Thread;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.own.demo.utils.DateUtils;
import com.own.demo.writerfile.WriterFileUtils;
import org.locationtech.jts.geom.Coordinate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.stream.Collectors;

/**
 * 线程启用接口
 *
 * @author heguanglong
 * @date 2023/6/13
 */
public class 所有点 implements Runnable {
    List<List<Coordinate>> allXYdata;
    String url;
    public 所有点(List<List<Coordinate>> allXYdata,String url) {
        this.allXYdata=allXYdata;
        this.url=url;
    }

    @Override
    public void run() {
        try {
            System.out.println(DateUtils.parseDateToStr(new Date())+" 所有点JSONArray");
            WriterFileUtils.writerFoFile(JSONArray.toJSONString(allXYdata),url,"//所有点JSONArray-"+DateUtils.getNewDateSs()+".json");
            System.out.println(DateUtils.parseDateToStr(new Date())+" 所有点JSONArray完成");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
